package database;


import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;

//import org.springframework.context.ConfigurableApplicationContext;

@EnableAutoConfiguration
@Configuration
@ComponentScan
public class Application {

    public static void main(String[] args) throws Throwable {

        new SpringApplication(Application.class).run(args);

        // ============= SAMPLE CODE ================

        /*ConfigurableApplicationContext context = SpringApplication.run(Application.class);
        UserRepository repository = context.getBean(UserRepository.class);

        // save a couple of Users
        repository.save(new User(15,"Jack Bauer"));
        repository.save(new User(16,"User 1"));
        repository.save(new User(17,"User 2"));
        repository.save(new User(18,"User 3"));
        repository.save(new User(19,"User 4"));

        // fetch all Users
        Iterable<User> users = repository.findAll();
        System.out.println("Users found with findAll():");
        System.out.println("-------------------------------");
        for (User user : users) {
            System.out.println(user);
        }
        System.out.println();

        context.close();*/

        // ============= SAMPLE CODE ================

    }
}